<!DOCTYPE html>
<html>

<head>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">


	<title>{$Think.config.site.title} - 采购单管理</title>

	<meta name="keywords" content="{$Think.config.site.keywords}">

	<link href="{$Think.config.site.resource_url}css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
	<link href="{$Think.config.site.resource_url}css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
	<link href="{$Think.config.site.resource_url}css/plugins/iCheck/custom.css" rel="stylesheet">
	<link href="{$Think.config.site.resource_url}css/animate.min.css" rel="stylesheet">
	<link href="{$Think.config.site.resource_url}css/style.min.css?v=4.0.0" rel="stylesheet">

</head>
<style>
	#listtable .fa {
		cursor: pointer;
		color: #1ab394;
		margin-right: 1em;
	}

	th .tag {
		font-size: 12px;
		color: #e66c6c;
		font-weight: normal;
	}

	.ibox-title .tag {
		font-size: 12px;
		color: #e66c6c;
		font-weight: normal;
		display: inline-block;
		margin-left: 20px;
	}

	.specval-hide {
		display: none;
	}

	.well p,
	span {
		color: #337ab7;
	}
	.goods_list {
		border-top: 1px solid #ccc;
		margin: 5px 0;
		padding-top: 5px;
		}

	.shipping_finish {
		float: right;
		border-radius: 5px;
		border: 1px solid #ccc;
		width: 30%;
		line-height: 35px;
		text-align: center;
	}
	.wrapper-content{
		padding:0px;
	}
	.wrapper{
		padding:0px;
	}
	.col-sm-12{
		padding-right:0px; 
	}
	.green{
		background: #A6EB94;
	}
	.ibox-title a{
		font-size: 14px;
	}
</style>

<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>采购商品列表</h5>
						<a href="{:url('login/logout')}" class="pull-right">退出</a>
						<!-- <span class="tag">说明：</span> -->
					</div>
					<div class="ibox-content" style="display: block;">
						{volist name="purchase" id="vo" key="k"}
						<div class="well {$vo.finish?green:''}">
							<p><span>任务{$vo.purchase_id}</span><span style="float:right">{$vo.create_time}</span></p>
							<span>{$vo.num}种商品，约￥{$vo.sum}</span><a style="float: right" href="{:url('Purchase/purchaseList')}?purchase_id={$vo.purchase_id}" class="btn btn-primary btn-sm">开始采购</a>
						</div>
						{/volist}
					</div>
				</div>
			</div>

		</div>
	</div>
	<script src="{$Think.config.site.resource_url}js/jquery.min.js?v=2.1.4"></script>
	<script src="{$Think.config.site.resource_url}js/bootstrap.min.js?v=3.3.5"></script>
	<script src="{$Think.config.site.resource_url}js/plugins/peity/jquery.peity.min.js"></script>
	<script src="{$Think.config.site.resource_url}js/plugins/iCheck/icheck.min.js"></script>
	<script src="{$Think.config.site.resource_url}js/plugins/layer/layer.js"></script>
	<script src="{$Think.config.site.common_resource_url}js/majax.js"></script>
	<script src="{$Think.config.site.common_resource_url}js/jedit.js"></script>
</body>

</html>
<script type="text/javascript">
	var layer_font = '';
	$(document).on('click', '.refund', function () {
		var order_goods_id = $(this).data('order_goods_id');
		layer_font = layer.open({
			type: 2,
			title: '退货',
			shadeClose: true,
			shade: 0.8,
			area: ['100%', '50%'],
			content: '{:url("refund")}?order_goods_id=' + order_goods_id //iframe的url
		});
	});
	function editSuccess(d) {
		layer.close(layer_font);
		layer.msg(d.msg, { icon: 1 }, function () {
			location.reload(true);
		});
	}

</script>
<!-- <script>

var layer_font='';
$(document).ready(function() {
	
	$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",});

	//全选
	$("#checkall").bind("ifChecked",function(){
		$("input[name='ids[]']").iCheck("check");
	});
	//取消全选
	$("#checkall").bind("ifUnchecked",function(){
		$("input[name='ids[]']").iCheck("uncheck");
	});
	//顶部按钮
    $("#nestable-menu").on("click",
    function(e) {
        var target = $(e.target),
        action = target.data("action");

		//保存排序
        if (action === "allot") {
            var list = [],goods='';
			$("input[name='ids[]']:checked").each(function(index, element) {
				list.push($(this).closest("tr").data("id"));
				
			});
			if(list.length < 1) {
				layer.msg('请至少选中一项', {icon: 5});
				return false;
			}
			
			layer_font = layer.open({
				type: 2,
				title: '选择配送员',
				shadeClose: true,
				shade: 0.8,
				area: ['900px', '90%'],
				content: '{:url("allot")}', //iframe的url
				btn: ['确定', '取消'],
				btn1: function(index, layero){
					var d = $('iframe',layero)[0].contentDocument;
					var uid = $("input[name='uid']:checked",d).val();
					if(uid == undefined) {
						layer.msg('未选择配送员', {icon: 2});
						layer.close(index);
						return false;
					}
					majax('{:url("allot")}',{uid:uid,ids:list.join(',')},function(d){
						if (d.code<=0) {
							layer.msg(d.msg, {icon: 5});
							layer.close(index);
						}
					})
				}
		  	});
        }

    });


	
});	
</script> -->